<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>发布精品课程</title>
</head>
<body>
<script type="text/javascript">
function isInteger(obj) {
    return obj%1 === 0
}

function check(){
var month=releaseCourse_form.uploadTimeMonth.value;
var day=releaseCourse_form.uploadTimeDay.value;
if(isInteger(month)&&isInteger(day)&&day>0&&day<=31&&month>0&&month<=12){
	return true;
}
else{
	alert("上传日期有误，无法上传");
	return false;
}
}

</script>
<%
String uploadID="";
if(session.getAttribute("session_userName")!=null){
	uploadID=session.getAttribute("session_userName").toString();
}
else if(session.getAttribute("session_admin")!=null){
	uploadID=session.getAttribute("session_admin").toString();
}
%>
	<link href="css/myRelease_teacher.css" rel="stylesheet" type="text/css" />
	<div class="header">
		<font size="6" color="#62A8EA"><br />&emsp;&emsp;&emsp;发布精品课程</font>
	</div>
	<div class="body">
		<form action="UploadServlet" method="post"
			enctype="multipart/form-data" name="releaseCourse_form" onsubmit="return check();">
			<table class="dataintable">
			<input type="hidden" name="uploadType" value="CourseResource"/>
				<tr>
					<td align="center">上传者：</td>
					<td colspan="6"><input type="text" 
						value=<%=uploadID%>
						name="uploader"></td>
				</tr>
				<tr>
					<td align="center">请选择上传文件：</td>
					<td colspan="6"><input type="file" name="fileName"></td>
				</tr>	
				<tr><td align="center">请选择标签：</td>
				<td colspan="6"><select name="label">
				<option value="andriod">Andriod</option>
				<option value="c">C</option>
				<option value="java">java</option>
				<option value="jsp">jsp</option>
				<option value="mysql">MySql</option>
				<option value="oracle">Oracle</option>
				<option value="php">PHP</option>
				<option value="python">python</option>
				<option value="sqlsever">SQL Sever</option>
	            <option value="other">other</option>
				</select></td></tr>
				<tr><td align="center">课程名称：</td>   <!-- 上传文件时一定要在后面加上文件类型,eg:c语言程序设计.zip -->
				<td colspan="6"><input type="text" name="courseName"></td></tr>
				<tr><td align="center">上传时间：</td>
				<td><input type="text" name="uploadTimeYear"></td><td>年</td>
				<td><input type="text" name="uploadTimeMonth"></td><td>月</td>
				<td><input type="text" name="uploadTimeDay"></td><td>日</td>
				</tr>
				<tr><td align="center">简介：</td><td colspan="6"><textarea name="briefIntroduce" rows="6" cols="50"></textarea></td></tr>
				<tr>
					<td align="center" colspan="7"><input type="submit"
						class="mybutton" value="上传"></td>
				</tr>
			</table>
		</form>
	</div>
	<div class="foot">
		<font color="white">Made by Aaron</font>
	</div>
</body>
</html>